<template>
  <el-container>
<!--    <input
      type="text"
      v-model="text"
      @keydown.enter="onCreateItem"
    >
    <button @click="onCreateItem">Add</button>-->
    <el-input
      placeholder="请输入内容"
      v-model="text"
      @keydown.enter="onCreateItem"
    >
    </el-input>
    <el-button type="primary"
               icon="el-icon-circle-plus"
               @click="onCreateItem"
    >
      Add
    </el-button>
  </el-container>
</template>

<script>
export default {
  name: "CreateTodo",
  data() {
    return {
      text: ''
    }
  },
  methods: {
    onCreateItem() {
      // console.log(this.text)
      this.$emit('item-data', {
        content: this.text
      })
      this.text = ''
    }
  }
}
</script>

<style scoped>

</style>